====== valueMean() ======

''float **valueMean**(string //question//)''

''float **valueMean**(string //question//, string|array //items//)''

''float **valueMean**(array //variables//)''

Calculates the mean (average, expectation value) of the answer codes for all items in a question (e.g. a scale), or for a list of variables.

  * //question// -- ID of a question (as a string)
  * //items// -- A list (string or array) of items
  * //variables// -- A list (array) of variable IDs as stated in the **Variables Overview**

**Note** This works in the same way as ''[[:en:create:functions:valuesum|valueSum()]]'' -- the parameters are described in this chapter in detail with various examples.


===== Example =====

In the following example, question "AB02" will be displayed if the mean in the scale "AB01" is at least 1.5.


<code php>
$mean = valueMean('AB01');
if ($mean >= 1.5) {
  question('AB02');
}
</code>